//
//  MusicApplicationViewController.m
//  MIDI
//
//  Created by 邵子凡 on 15/10/28.
//  Copyright © 2015年 QXSX. All rights reserved.
//

#import "MusicApplicationViewController.h"
#import "AddMusicTableViewCell.h"
#import "AddMusicTitlePageCell.h"
#import "AddMusicContentCell.h"
#import "AddMusicButtonCell.h"
#import "UIViewController+NavItem.h"
#import "AppConfig.h"

@interface MusicApplicationViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation MusicApplicationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tableView.dataSource = self;
    
    self.tableView.delegate = self;
    
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    self.tableView.backgroundColor = UIColorRGBA(235, 235, 235, 1);
    
    //导航栏返回按钮
    [self settingLeftBarButtonItem];
    
    //导航栏标题
    self.navigationItem.title = @"音频申请";
    
}

- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 4;
    
}

- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row == 0) {
        
        
        return 214;
        
    }
    
    if (indexPath.row == 1) {
        
        
        
        return 100;
        
    }
    if (indexPath.row == 2) {
        
        
        return 192;
        
    }
    if (indexPath.row == 3) {
        
        return 83;
        
    }
    
    return 1;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row == 0) {
        
        AddMusicTableViewCell * cell = [AddMusicTableViewCell cellWithTableView:tableView];
        
        return cell;
        
    }
    
    if (indexPath.row == 1) {
        
        AddMusicTitlePageCell * cell = [AddMusicTitlePageCell cellWithTableView:tableView];
        
        return cell;
        
    }
    if (indexPath.row == 2) {
        
        AddMusicContentCell * cell = [AddMusicContentCell cellWithTableView:tableView];
        
        return cell;
        
    }
    if (indexPath.row == 3) {
        
        AddMusicButtonCell * cell = [AddMusicButtonCell cellWithTableView:tableView];
        
        return cell;
        
    }
    
    return nil;
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
